import { Injectable } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";

import { AWordEntity } from "./aWord.entity";

@Injectable()
export class AWordService{
    constructor(
        @InjectRepository(AWordEntity)
        private readonly aWordService:Repository<AWordEntity>,

    ){}

    async findAllBlog(){
        return await this.aWordService
        .createQueryBuilder('aWord')
        .getMany()
    }
    async add(aWord){
        return await this.aWordService.save(aWord)
    }
    async remove(aWordId){
        return await this.aWordService.delete(aWordId)
    }
    async update(aWord){
        return await this.aWordService.update(aWord.wordId,aWord)
    }
}